const ArticleModel = require('../models/article')

const find = async (condition = {}) => {
    let list = []
    try {
        condition.isDelete = false
        // 根据条件查询, 按照时间倒序
        list = await ArticleModel.find(condition).sort({
            createTime: 'desc'
        })
    } catch (error) {
        console.error(error)
    }
    return list
}

module.exports = {
    find
}
